package com.kfm.pm;

import java.util.Arrays;
import java.util.Scanner;

public class Demo06 {

    public static void main(String[] args) {
        // 给定一个整数数组，输入位置 n 和值 k。将值 k 插入到数组的第 n 位并输出新数组的每一
        // 个元素。
        int[] arr = {12, 23, 34, 19, 25, 17, 23, 17, 19};
        int[] newArr = new int[arr.length + 1];
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        System.arraycopy(arr, 0, newArr, 0, n);
        newArr[n] = k;
        System.arraycopy(arr, n, newArr, n + 1, arr.length - n);
        System.out.println(Arrays.toString(newArr));
    }
}
